import bb.cascades 1.0

Page {
    actions: [
        // define the actions for first tab here
        ActionItem {
            title: qsTr("Rotate")
            onTriggered: {
                //                imgTab1.rotationZ = imgTab1.rotationZ + 90;
            }
        },
        ActionItem {
            title: qsTr("Break")
            onTriggered: {
                //                imgTab1.imageSource = "asset:///images/picture1br.png";
            }
        }
    ]
    
    Container {
        ListView {
            dataModel: ArrayDataModel {
                id: arrayModel
            }
            
            onCreationCompleted: {
                for ( var a = 0; a < 20; a++ ) {
                    arrayModel.append("Item" + a);
                }
                arrayModel.append(["Appended 1", "Appended 2"]);
                arrayModel.removeAt(0);
                arrayModel.insert(0,["Prepended 1", "Prepended 2"]);
            }
            
            
            // Add appearance definitions for the list items using the
            // listItemComponents list
            listItemComponents: [
                
                // The first ListItemComponent defines how "header" items
                // should appear. These items use a Label.
//                ListItemComponent {
//                    type: "header"
//                    Label {
//                        text: ListItemData.title
//                        
//                        // Apply a text style to create a large, bold font with
//                        // a specific color
//                        textStyle {
//                            base: SystemDefaults.TextStyles.BigText
//                            fontWeight: FontWeight.Bold
//                            color: Color.create ("#7a184a")
//                        }
//                    }
//                },
                
                // The second ListItemComponent defines how "listItem" items
                // should appear. These items use a Container that includes a
                // CheckBox and a Label.
                ListItemComponent {
                    type: "listItem"
                    Container {
                        layout: StackLayout {
                            orientation: LayoutOrientation.LeftToRight
                        }
                        CheckBox {
                            // Determine whether the CheckBox should be checked
                            // according to a value in the data model
                            checked: ListItemData.checked
                        }
                        Label {
                            text: ListItemData.title
                            
                            // Apply a text style to create a title-sized font
                            // with normal weight
                            textStyle {
                                base: SystemDefaults.TextStyles.TitleText
                                fontWeight: FontWeight.Normal
                            }
                        }
                    } // end of Container
                } // end of second ListItemComponent
            ] // end of listItemComponents list
        } // end of ListView
    
    }
}
